﻿@model IEnumerable<Promocot.Models.Promocion>

@{
    ViewBag.Title = "Index";
}
  <script src="@Url.Content("~/Scripts/jquery.tablePagination.0.4.js")" type="text/javascript"></script>
<script type="text/javascript">
    $(function () {

        $("#fecha").datepicker({
            dayNames: ['Domingo', 'Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado'],
            dayNamesShort: ['Dom', 'Lun', 'Mar', 'Mie', 'Jue', 'Vie', 'Sab'],
            dayNamesMin: ['Do', 'Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sa'],
            monthNamesShort: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'],
            changeMonth: true,
            changeYear: true,
            dateFormat: "dd/mm/yy"
        });
      
        $("#tabla_promos").tablePagination();


    });
</script>
<div class="filtros">
@using (Html.BeginForm("Promo_Filtrar","Promocion",FormMethod.Post))
{
<table>
<tr>
<th># Promocion</th><th>Tags</th><th>Fecha</th><td rowspan="2"><input type="submit" name="enviar" value="Filtrar" /></td>
</tr>

<tr>
<td>@Html.Editor("num_promo", new { id="num_promo"})</td><td>@Html.Editor("tags")</td><td>@Html.Editor("fecha")</td>
</tr>
</table>
}
</div>
@if (Model.Count() > 0)
{
<table id="tabla_promos">
<tbody>

@if (Session["empresa"].Equals("passarini"))
{
    foreach (var pro in Model)
    {
        if (pro.titulo != null)
        {
    <tr><td>@Html.ActionLink(pro.titulo, "detalle/" + pro.cod_promocion)</td></tr>
        }
    }
}
    
</tbody>
</table>
}
else { 

<h5>La consulta no generó resultados.</h5>
}